home *** CD-ROM | disk | FTP | other *** search
- Hi Mush,
-
- > >> OK, ill try and explain this problem again. Im making a perspective
- > >> box/rectangle, so naturally, one end will be close, and the other end
- > >> smaller, so simulate the depth of the box. Here is an example: (crap
- > ASCII art)
- >
- > I know the top coords of the 2 lines drawn, but it is the top and bottom Y
- > coordinates on the actual SLOPES that I need to know quickly
-
- It sounds like you are already using run length slicing.
- This is just about the fastest way of drawing a line IF you are coding in
- assembly.
-
- You could speed up the inner loop by checking for the gradient before you
- start the loop and branching to four seperate routines depending on the
- gradient.
-
-
- /<--45%
- |1 /
- | / 2
- |/____
- |\
- | \ 3
- |4 \
-
- You probably know that already, can you be a little more specific about
- what you need? what are you actually doing with the result, and how is this
- function to be called? do you calc every value from left to right? do you
- need multiple y values for a single x in quadrants 1 and 4.
-
- I guess you use 'If' to avoid a divide?
-
- Division is slow. The bitwise Ror is a faster way to divde by 2. that would
- at least give you the centre of the line, I think AMOSPro auto converts
- those divisions, but the point is to divide by 2 or 4, not 5...
-
- Hope this helps...
-
- --
- Adam.
-
-
-
-